#include <dbg.h>
#include <gtest/gtest.h>
using namespace std;

class Solution {
public:
    bool checkZeroOnes(string s) {
        return countSubStr(s, '1') > countSubStr(s, '0');
    }

private:
    int countSubStr(string s, char c) {
        int res = 0;
        int cnt = 0;
        for (char ch : s) {
            if (ch == c) {
                ++cnt;
            } else {
                res = max(res, cnt);
                cnt = 0;
            }
        }
        res = max(res, cnt);
        return res;
    }
};

TEST(TEST1, checkZeroOnes) {
    Solution solution;

    string s = "1101";
    EXPECT_EQ(solution.checkZeroOnes(s), true);
}

TEST(TEST2, checkZeroOnes) {
    Solution solution;

    string s = "111000";
    EXPECT_EQ(solution.checkZeroOnes(s), false);
}

TEST(TEST3, checkZeroOnes) {
    Solution solution;

    string s = "110100010";
    EXPECT_EQ(solution.checkZeroOnes(s), false);
}

int main(int argc, char** argv) {
    ::testing::InitGoogleTest(&argc, argv);
    return RUN_ALL_TESTS();
}